UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ItQKTX/XvlB2ZggGhvidnRw4w/Xa0cIZLXG8KdlTcY8=' 
WHERE 
  key_id = '8dbecd17a83381cddb28a95da5053c9ee7ab5f24a2e1a175ea43464acfd31f5f' 
  AND (
    token = 'ItQKTX/XvlB2ZggGhvidnRw4w/Xa0cIZLXG8KdlTcY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057