UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ueD8fYa76LSkqon+IfpFHnl9qFvxGnNVhrEPLgTq4b0=' 
WHERE 
  key_id = '5c0948e1609efea15562fd77824d4140004dfed1d0a681b4792430220f65c866' 
  AND (
    token = 'ueD8fYa76LSkqon+IfpFHnl9qFvxGnNVhrEPLgTq4b0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042