UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZY0Prh+SyfPdZ/b642Gltc6fMw1zLmYORSA5CgJCCs8=' 
WHERE 
  key_id = '34b2b301a91b572cc357d05e9294dfb2daf03deb5b6ffac52e0ea5555f7ce01f' 
  AND (
    token = 'ZY0Prh+SyfPdZ/b642Gltc6fMw1zLmYORSA5CgJCCs8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050