UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sjJBks/z+t8JGic6disUJ8eZFAdCjQqczdAPU5ws84E=' 
WHERE 
  key_id = '948786a7dd59a0b002faed2e98d7d5fb02cb998543bb54a9535a7fe90abff9bf' 
  AND (
    token = 'sjJBks/z+t8JGic6disUJ8eZFAdCjQqczdAPU5ws84E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030