UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pbxcdws+IS1PmpLFjqE57qeKpIv7K2u/fZ8FvTbAltE=' 
WHERE 
  key_id = '61575f7a03c9f69bc2666dd417e6addc683b6d7bfc482ae863ba7d3265dd4dc1' 
  AND (
    token = 'Pbxcdws+IS1PmpLFjqE57qeKpIv7K2u/fZ8FvTbAltE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034