UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PQeVshXaxpTQF0oqChGbTdQPrFD/4XZvhKoqNitl8D0=' 
WHERE 
  key_id = 'f80652487087832eeedd5bf39ac81d102e6b824d5eea33c7738d466a5554922c' 
  AND (
    token = 'PQeVshXaxpTQF0oqChGbTdQPrFD/4XZvhKoqNitl8D0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028