UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hXMOixhLlKURbfkQtbKJi147BSHknWULWCihrtkLJ8g=' 
WHERE 
  key_id = '159e6d3ae5376f00df64676df70734b5506f02f6d75617408866cb9db5d09c0a' 
  AND (
    token = 'hXMOixhLlKURbfkQtbKJi147BSHknWULWCihrtkLJ8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031