UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V6hM9OL9gkpXT+bA5NSFp3rLK7lVPCSFP9v17DQeGG0=' 
WHERE 
  key_id = '5c6d8536d2ed01899d7390e6820ce7cf0b1bcfeb7ae9e27fe8695199e888b9ea' 
  AND (
    token = 'V6hM9OL9gkpXT+bA5NSFp3rLK7lVPCSFP9v17DQeGG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067