UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2fG3GKKLORQM94XFKn2WqrtbauTjzJr0qXqLNvrkmA=' 
WHERE 
  key_id = 'dd6276632c916906b6778cc7e9d0841c138172dce0d74be11f724a9c30c4d000' 
  AND (
    token = 'e2fG3GKKLORQM94XFKn2WqrtbauTjzJr0qXqLNvrkmA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029