UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvPmzVnBNVvWmM2buNVjQxkmxTbJjT7zELbJymYh5VU=' 
WHERE 
  key_id = '50e01168ef4fcc35b23d013b9fee946ca0faa14f8e7ebe60e7ca90c0fde5ddf6' 
  AND (
    token = 'EvPmzVnBNVvWmM2buNVjQxkmxTbJjT7zELbJymYh5VU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031