UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3GjEnMauYCOkRTP3U526XSLXnuMHjn0qZLtYtbJQjos=' 
WHERE 
  key_id = '7a1876cc478b4258bab834b286aac4e25c7abd8d767603eb70ff08cf721d54a2' 
  AND (
    token = '3GjEnMauYCOkRTP3U526XSLXnuMHjn0qZLtYtbJQjos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021