UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd9u0Ab7xzr6I1VGva+WWUxjmdeoPLB1x8FxhB2+e37U=' 
WHERE 
  key_id = '0e60c7abe1262f05c27040608ba51bfc8ede6c864877634db808753e9b48dc6f' 
  AND (
    token = 'd9u0Ab7xzr6I1VGva+WWUxjmdeoPLB1x8FxhB2+e37U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026