UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '22u/bAnshHa1pOOZ3DDw5HHVPBchZc82GUZIhf/pNyg=' 
WHERE 
  key_id = 'f42e0e097d290b8e204513edd196cc7eb407003aa927a5d206953d5273943a58' 
  AND (
    token = '22u/bAnshHa1pOOZ3DDw5HHVPBchZc82GUZIhf/pNyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035