UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'glQ0B4DnvV5D3JS4UvGEcQuFX0nCEr0cacgqS8mXcLc=' 
WHERE 
  key_id = 'cdf0ae55b8db623e68bda9861ff39073627e783d6f6531851aae5550d5c642ba' 
  AND (
    token = 'glQ0B4DnvV5D3JS4UvGEcQuFX0nCEr0cacgqS8mXcLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045