UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gtqbGaIvio/wrdF2HtaYvMUyJL4Y+CSzMDH6O5GRAzA=' 
WHERE 
  key_id = '53b7b7a6f42fd796f383c1a5fae9f1f953cd74bc1722a6b72a28769a300f8b5a' 
  AND (
    token = 'gtqbGaIvio/wrdF2HtaYvMUyJL4Y+CSzMDH6O5GRAzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037