UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uWglzmzWk42T2BE3GA8R/7kFQH2f1TeuVitQ+7iRkMc=' 
WHERE 
  key_id = '57baf3a56ae20f50e96842d9e926a19c6a78c6d1c9c68f027b11ea1b575a9434' 
  AND (
    token = 'uWglzmzWk42T2BE3GA8R/7kFQH2f1TeuVitQ+7iRkMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073