UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'llUvgKnyJNZz9GhOFTPet/XwUaf/WON0CNEjsFa9p3g=' 
WHERE 
  key_id = '4f47c3762ca66c021742d18419e587bdbb19ae5d4becbbbcf154a4587dd297bf' 
  AND (
    token = 'llUvgKnyJNZz9GhOFTPet/XwUaf/WON0CNEjsFa9p3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067