UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7GG8my6wTGqxBEDtznwjd6ONlxvdE6u0kOP92vK8wHQ=' 
WHERE 
  key_id = 'c75594aa487fa3b0b2dc876b7e49abe4decc1fdb176afcd9680b5feb6d780690' 
  AND (
    token = '7GG8my6wTGqxBEDtznwjd6ONlxvdE6u0kOP92vK8wHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047