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

Query time 0.00028