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

Query time 0.00034