UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oWaxmlHD1DSHcoCke4nRRuCoCN0ikCP0Tv6VafaEmik=' 
WHERE 
  key_id = '8bfa80ee3d7c089e532d92a95b908428653591ec0c53e3f3037b59038f05af28' 
  AND (
    token = 'oWaxmlHD1DSHcoCke4nRRuCoCN0ikCP0Tv6VafaEmik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030