UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Nb8HAF5m6LovZj9jCy72X27sTfyN0sLyNOdW1qxBtc=' 
WHERE 
  key_id = '72e5a37dc3120a3b324b56c8da8627d163e5d3e0ff73a2308b2b90fe6ef992d6' 
  AND (
    token = '2Nb8HAF5m6LovZj9jCy72X27sTfyN0sLyNOdW1qxBtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023