UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P44WcpLKUEKRyrORp9OxITi2AaAiaYUMcBzlgpb4IEY=' 
WHERE 
  key_id = '92d13c443e5b33555f3850398b60dee8505cbb1fcc23a1228a8249993cb1ec9c' 
  AND (
    token = 'P44WcpLKUEKRyrORp9OxITi2AaAiaYUMcBzlgpb4IEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032