UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't3NSPqH5z/bm+Ob5TiF+1h5VyPZ7gLWVwcv3xsKeMCQ=' 
WHERE 
  key_id = 'a02324e502c6fa82e5844db2fc0f9b279758c81824ff90932c0676aba29a3234' 
  AND (
    token = 't3NSPqH5z/bm+Ob5TiF+1h5VyPZ7gLWVwcv3xsKeMCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032