UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e8xVvSyptP7gRTaIzdi91naI2COqcGyqnzrFw2JXd1I=' 
WHERE 
  key_id = '701b1061de3ffdbc0bd752881953933e6f2bef300a90ee4c5963f7f024887134' 
  AND (
    token = 'e8xVvSyptP7gRTaIzdi91naI2COqcGyqnzrFw2JXd1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021