UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u3MVD0DMuLWMu0rLpesVf18OnMg02GDAc3GtUUZ64Cc=' 
WHERE 
  key_id = '690f777ce8e2834a0c4b94ac0dc54d51c9fb7a01e943cc32b4a5baa6089f8bc5' 
  AND (
    token = 'u3MVD0DMuLWMu0rLpesVf18OnMg02GDAc3GtUUZ64Cc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043