UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fv1ghxm58wIfKe4GwC+lNH8GYstx7dVTr3cIrp181hg=' 
WHERE 
  key_id = '30030c80b1acefc9005a8663382c3bc39658d472fb16611660aeff5dc126e189' 
  AND (
    token = 'Fv1ghxm58wIfKe4GwC+lNH8GYstx7dVTr3cIrp181hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055