UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YnvndQEWG6EstuYwboucrIXIO9/3ABx3kTp/23vx+VE=' 
WHERE 
  key_id = 'e702c906ebb7c8a187c3d9dcb0d04a207226e8473d6f5578b3ddf9e42039a8a2' 
  AND (
    token = 'YnvndQEWG6EstuYwboucrIXIO9/3ABx3kTp/23vx+VE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044