UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZzDNKAaE0VOfCg2kN83JrSnNVqxh+PXyVLp8/fOi+Uw=' 
WHERE 
  key_id = 'c3b64eed2dcedabbf3fa378e5dd56dc2b7b4aa5385f4894848804dd1bd02361e' 
  AND (
    token = 'ZzDNKAaE0VOfCg2kN83JrSnNVqxh+PXyVLp8/fOi+Uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031