UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yOEA/eZWa6J5Wpzjp+LyMLAYwRojjY7SHBG8EVj8VtE=' 
WHERE 
  key_id = '8b59216c9bd4be0d9eedf9a81645e44ee81e98d1bb2b6a1867f455c1445aa9af' 
  AND (
    token = 'yOEA/eZWa6J5Wpzjp+LyMLAYwRojjY7SHBG8EVj8VtE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033