UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vCDxwImsO6phMaF8v5mZsINfHkZZFMWP8Gs1bPKjNUY=' 
WHERE 
  key_id = '338ed23cfda54e3eb9d467dcd63ec6c5fdb052b33541885f7beb8544d5967ebc' 
  AND (
    token = 'vCDxwImsO6phMaF8v5mZsINfHkZZFMWP8Gs1bPKjNUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022