UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ce11y3oCpr14xRDpoQyCTgcxGsNQdiZIZmlHjbZzjk=' 
WHERE 
  key_id = 'd3d9f245b51f3913d452578db8f1108891af8631df281839a473719c862b6411' 
  AND (
    token = '9ce11y3oCpr14xRDpoQyCTgcxGsNQdiZIZmlHjbZzjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030