UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8FmzsKEjVJ3y/wWNhy1pEWIbco+kwO9dzFi4isyczpU=' 
WHERE 
  key_id = '437f6784471982a3ad2e17d772ef981ad69b55863c417e49968b39b489486b4e' 
  AND (
    token = '8FmzsKEjVJ3y/wWNhy1pEWIbco+kwO9dzFi4isyczpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074