UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OYJN/AhGNLoISds8f/GmNSglIN/sz/SCD+DF1pUg6iQ=' 
WHERE 
  key_id = '341cf5a432adddbf99dd0aa56600ca0bd712f50100d5a3f0870758f3a3d6825b' 
  AND (
    token = 'OYJN/AhGNLoISds8f/GmNSglIN/sz/SCD+DF1pUg6iQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018