UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1MunkxarUsqR5trJwrVK3GQVY+RYo6KhYUo+hSvHEVA=' 
WHERE 
  key_id = '9e3df27152a7b8e78d49474ee437492689c273141cccfb9c4c0f5f323e6b4dc8' 
  AND (
    token = '1MunkxarUsqR5trJwrVK3GQVY+RYo6KhYUo+hSvHEVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037