UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ZPqV8GO0i8ijwjNxbOtLfe3Uq6fU7s95QfCfqrndDQ=' 
WHERE 
  key_id = '13e2404266fddcc133203a82ed528e487ced2e3872a097c1f355a78fb246ac10' 
  AND (
    token = '+ZPqV8GO0i8ijwjNxbOtLfe3Uq6fU7s95QfCfqrndDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039