UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LbEmvDOasMRnUSeU1Gdh3v2YKPCSgWmaBGbOxVpCtwY=' 
WHERE 
  key_id = '4764220085fcac278adbc33ab77a5aeb54935fdc7dc410a2b5a5dd3e259fe39b' 
  AND (
    token = 'LbEmvDOasMRnUSeU1Gdh3v2YKPCSgWmaBGbOxVpCtwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044