UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '04Bd+tNtjfrWRMVntEUbdRDUUEAb8qEq3NAJRwNkgvc=' 
WHERE 
  key_id = '04a794b43660afc88f7ef4c9ced0832b5364b0ea7c336f3258b9ef1344d89afa' 
  AND (
    token = '04Bd+tNtjfrWRMVntEUbdRDUUEAb8qEq3NAJRwNkgvc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018