UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bzas2fz9WuSs502cLrVTdM71D1WgKuMUyNEkXNLzHHU=' 
WHERE 
  key_id = 'e61fbe600085ad8c69f24550202d2f81801070e4487f2b99433fa9f224f114c2' 
  AND (
    token = 'Bzas2fz9WuSs502cLrVTdM71D1WgKuMUyNEkXNLzHHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028