UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ELOgGwH/3Jb5UDT1dQND5jyXjLW2gBGkbJSG9Au3AM=' 
WHERE 
  key_id = '792e30428d6d186a0d16f057528b36fb982ebd8dc30b45ed7c39cd63a04a9696' 
  AND (
    token = '0ELOgGwH/3Jb5UDT1dQND5jyXjLW2gBGkbJSG9Au3AM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035